<template>
    <div class="app_order_list" @scroll="onScroll($event)">
        <div class="top">
            <div id='oplist'>
                <div class="op" :class="status=='all'?'activate':''" id="status_all" @click="setstatus('all')">全部</div>
                <div class="op" :class="status==0?'activate':''" id="status_0" @click="setstatus(0)">待付款</div>
                <div class="op" :class="status==1?'activate':''" id="status_1" @click="setstatus(1)">待发货</div>
                <div class="op" :class="status==2?'activate':''" id="status_2" @click="setstatus(2)">待收货</div>
                <div class="op" :class="status==3?'activate':''" id="status_3" @click="setstatus(3)">已完成</div>
                <div class="op" :class="status==4?'activate':''" id="status_4" @click="setstatus(4)">已取消</div>
            </div>
        </div>

        <div id="list">
            <div class="order" v-for='(item,index) in list' :key='index'>
                <div class="title">{{item.orderno}}</div>
                <div class="goods_list">
                    <div class="item" v-for='(subitem,index) in item.goods_list' :key='index'>
                        <div class="pic"><img :src="resurl+subitem.pic+'?x-oss-process=image/resize,m_fill,w_240,h_240'"
                                              alt=""></div>
                        <div class="name">{{subitem.name}}</div>
                        <div class="price">￥{{subitem.price}}</div>
                        <div class="buynumber">x{{subitem.buynumber}}</div>
                    </div>
                </div>
                <div class="info">
                    <div class="line">下单时间:{{item.datetime}}</div>
                    <div class="line">订单总额:<span class="price">￥{{item.totalprice}}</span></div>
                    <div class="line">订单状态:{{item.status_str}}</div>
                </div>
                <div class="op">
                    <div v-if="item.status==0" @click="pay(item.orderno)" class="btn">付款</div>
                    <div v-if="item.status==0" @click="cancel(item.orderno)" class="btn">取消</div>
                    <div v-if="item.status==2" @click="confirm(item.orderno)" class="btn">完成</div>
                    <div v-if="item.status==2||item.status==3" @click="toexplist(item.orderno)" class="btn">查看物流
                    </div>
                </div>
            </div>
        </div>
    </div>

</template>

<script src="./main.js">

</script>

<style lang="less" src="./main.less" scoped></style>
